-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Workflow action 'email to host' only sends to one host of team e… #14767
base: main
Are you sure you want to change the base?
fix: Workflow action 'email to host' only sends to one host of team e… #14767
Conversation
@Amit91848 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
Graphite Automations"Add community label" took an action on this PR • (04/26/24)1 label was added to this PR based on Keith Williams's automation. "Add consumer team as reviewer" took an action on this PR • (04/26/24)1 reviewer was added to this PR based on Keith Williams's automation. |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/trpc/server/routers/viewer/workflows/update.handler.ts
Outdated
Show resolved
Hide resolved
hosts: { | ||
select: { | ||
user: { | ||
select: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried using variable, typescript compiler wasn't having it so had to repeat this
@@ -391,8 +391,7 @@ describe("handleNewBooking", () => { | |||
}); | |||
|
|||
expectWorkflowToBeTriggered({ | |||
// emailsToReceive: [organizer.email].concat(otherTeamMembers.map(member => member.email)), | |||
emailsToReceive: [organizer.email], | |||
emailsToReceive: [organizer.email].concat(otherTeamMembers.map((member) => member.email)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also add a unit test for this? and make sure to test if all the hosts receive email
Instead of writing a new test uncommented this as this tests for receiving emails for all hosts.
const hosts = reminder.booking.attendees | ||
.filter((attendee) => | ||
reminder.booking?.eventType?.hosts?.some((host) => host.user.email === attendee.email) | ||
) | ||
.map((host) => host.email); | ||
const schedulingType = reminder.booking.eventType?.schedulingType; | ||
|
||
if ( | ||
hosts && | ||
(schedulingType === SchedulingType.COLLECTIVE || schedulingType === SchedulingType.ROUND_ROBIN) | ||
) { | ||
sendTo = sendTo ? [sendTo, ...hosts] : hosts; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine but what if user has connected a calendar. in that case we send the email and create calendar invite only on the connected calendar email address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure wdym but that. Since user is host wouldn't he already have calendar invite? Also isn't calendar.ics being sent with the mail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
email address in user' account could be different than connected calendar email
What does this PR do?
Fixes #14739
Don't have sendgrid so couldn't show the email, logged the info instead
Screen.Recording.2024-04-26.at.2.56.42.PM.mov
Type of change
Mandatory Tasks